package com.zhanghe.study.springcloudalibaba.controller;

import com.zhanghe.study.springcloudalibaba.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zh
 * @date 2021/9/15 16:05
 */
@RestController
@RequestMapping("/storage")
public class StorageController {

    @Autowired
    private StorageService storageService;

    @PostMapping("/decrease")
    public void decrease(@RequestParam("productId") int productId, @RequestParam("count") int count){
        storageService.decrease(productId, count);
    }
}
